//
//  main.cpp
//  KY111 日期差值
//
//  Created by Yan Zihao on 2024/9/22.
//

#include <iostream>
using namespace std;
int day[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};

int leap_year(int year)
{
    if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}

int main(void)
{
    int day1,day2,month1,month2,year1,year2;
    scanf("%4d%2d%2d",&year1,&month1,&day1);
    scanf("%4d%2d%2d",&year2,&month2,&day2);
    
    int sum1 = 0,sum2 = 0;
    //**************************************
    for (int i = 0; i<year1; i++)
    {
        if(leap_year(i))
        {
            sum1 += 366;
        }
        else
        {
            sum1 += 365;
        }
    }
    
    if(leap_year(year1))
    {
        day[2] = 29;
    }
    else
    {
        day[2] = 28;
    }
    
    for (int j = 0; j<month1; j++)
    {
        sum1 += day[j];
    }
    sum1 += day1;
    //***************************************
    for (int i = 0; i<year2; i++)
    {
        if(leap_year(i))
        {
            sum2 += 366;
        }
        else
        {
            sum2 += 365;
        }
    }
    
    if(leap_year(year1))
    {
        day[2] = 29;
    }
    else
    {
        day[2] = 28;
    }
    
    for (int j = 0; j<month2; j++)
    {
        sum2 += day[j];
    }
    sum2 += day2;
    
    int a = abs(sum1 - sum2)+1;
    cout << a << endl;
    
    return 0;
}



